from playLA.Vector import Vector

if __name__=='__main__':
    u = Vector([3,4])
    print(u)
    print(len(u))
    print("[{},{}]".format(u[0],u[1]))

    u2 = Vector([3,1])

    # print("{}+{}={}".format(u,u2,u+u2))
    # print("{}-{}={}".format(u,u2,u-u2))
    # print("{}*{}={}".format(u,3,u*3))
    # print("{}*{}={}".format(3,u,3*u))
    # print("-%s=%s" % (u,-u))
    print(u.norm())
    print(u.normalize())

    zero2 = Vector.zero(2)

    # try:
    #     zero2.normalize()
    # except ZeroDivisionError:
    #     print("Cannot normalize zero vector {}!".format(zero2))

    print(u.dot(u2))
